import * as mongoose from 'mongoose';

export const CommentSchema = new mongoose.Schema({
  // 评论ID
  id: mongoose.SchemaTypes.ObjectId,
  // 问题ID
  issueId: mongoose.SchemaTypes.ObjectId,
  // 评论者ID
  userId: mongoose.SchemaTypes.ObjectId,
  // 评论内容
  content: String,
  // 创建时间
  createdAt: {
    type: Date,
    default: Date.now,
  },
  // 附件信息
  attachments: {
    type: [mongoose.SchemaTypes.Mixed],
    required: false,
  },
  // 团队ID
  teamId: mongoose.SchemaTypes.ObjectId,
});